/*
 * Copyright (C) 2016 yixun All Rights Reserved.
 * 
 * ImportStatistics.java
 */
package com.emm.yixun.common.model;
import java.io.Serializable;
import java.math.BigDecimal;

import com.alibaba.fastjson.annotation.JSONField;
import com.emm.yixun.common.utils.MathUtil;

import java.util.Date;

/**
 * [文件名称]<br>
 * ImportStatistics.java<br>
 * <br>
 * [文件描述]<br>
 * 导入统计表 pojo bean<br>
 * <br>
 * [修改记录]<br>
 * 2016-11-15 11:14:13 创建<br>
 * @version 1.00
 */
public class ImportStatistics implements Serializable{
    /**
	 * 序列化UID
	 */
	private static final long serialVersionUID = 1L;

	/**
	 *主键、自动增长
	 */
	private Long id;
	/**
	 *字数不限制
	 */
	private String title;
	/**
	 *总数目
	 */
	private Integer total;
	/**
	 *成功条数
	 */
	private Integer successCount;
	/**
	 *失败条数
	 */
	private Integer failCount;
	/**
	 *成功率
	 */
	private BigDecimal successRatio;
	/**
	 *商户ID
	 */
	private Long merchantId;
	/**
	 *创建人ID,关联用户表
	 */
	private Long createUserId;
	/**
	 *创建时间格式：yyyy-MM-dd HH:mm:ss
	 */
	@JSONField (format="yyyy-MM-dd HH:mm:ss")
	private Date createTime;
	/**
	 *修改人ID,关联用户表
	 */
	private Long updateUserId;
	/**
	 *修改时间格式：yyyy-MM-dd HH:mm:ss
	 */
	@JSONField (format="yyyy-MM-dd HH:mm:ss")
	private Date updateTime;
	/**
	 *是否删除:0否 1是
	 */
	private String delFlag;
	//未拨打数量
	private Long notDialCount;
	
	//待跟进数量
	private Long notFollowCount;
	
	//已转客数量
	private Long effectiveCount;
	
	//无效数量
	private Long invalidCount;
	
	//转客率=(转客数/导入成功数)
	private String effectiveRate;
	
	//导入人名称
	private String createUserName;
	

	/**	 
	 *设置 :主键、自动增长
	 */
	public void setId(Long id) {
		this.id = id;
	}

	/**	 
	 *获取 :主键、自动增长
	 */
	public Long getId() {
		return this.id;
	}

	/**	 
	 *设置 :字数不限制
	 */
	public void setTitle(String title) {
		this.title = title;
	}

	/**	 
	 *获取 :字数不限制
	 */
	public String getTitle() {
		return this.title;
	}

	/**	 
	 *设置 :总数目
	 */
	public void setTotal(Integer total) {
		this.total = total;
	}

	/**	 
	 *获取 :总数目
	 */
	public Integer getTotal() {
		return this.total;
	}

	/**	 
	 *设置 :成功条数
	 */
	public void setSuccessCount(Integer successCount) {
		this.successCount = successCount;
	}

	/**	 
	 *获取 :成功条数
	 */
	public Integer getSuccessCount() {
		return this.successCount;
	}

	/**	 
	 *设置 :失败条数
	 */
	public void setFailCount(Integer failCount) {
		this.failCount = failCount;
	}

	/**	 
	 *获取 :失败条数
	 */
	public Integer getFailCount() {
		return this.failCount;
	}

	/**	 
	 *设置 :成功率
	 */
	public void setSuccessRatio(BigDecimal successRatio) {
		this.successRatio = successRatio;
	}

	/**	 
	 *获取 :成功率
	 */
	public BigDecimal getSuccessRatio() {
		return this.successRatio;
	}

	/**	 
	 *设置 :商户ID
	 */
	public void setMerchantId(Long merchantId) {
		this.merchantId = merchantId;
	}

	/**	 
	 *获取 :商户ID
	 */
	public Long getMerchantId() {
		return this.merchantId;
	}

	/**	 
	 *设置 :创建人ID,关联用户表
	 */
	public void setCreateUserId(Long createUserId) {
		this.createUserId = createUserId;
	}

	/**	 
	 *获取 :创建人ID,关联用户表
	 */
	public Long getCreateUserId() {
		return this.createUserId;
	}

	/**	 
	 *设置 :创建时间格式：yyyy-MM-dd HH:mm:ss
	 */
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	/**	 
	 *获取 :创建时间格式：yyyy-MM-dd HH:mm:ss
	 */
	public Date getCreateTime() {
		return this.createTime;
	}

	/**	 
	 *设置 :修改人ID,关联用户表
	 */
	public void setUpdateUserId(Long updateUserId) {
		this.updateUserId = updateUserId;
	}

	/**	 
	 *获取 :修改人ID,关联用户表
	 */
	public Long getUpdateUserId() {
		return this.updateUserId;
	}

	/**	 
	 *设置 :修改时间格式：yyyy-MM-dd HH:mm:ss
	 */
	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	/**	 
	 *获取 :修改时间格式：yyyy-MM-dd HH:mm:ss
	 */
	public Date getUpdateTime() {
		return this.updateTime;
	}

	/**	 
	 *设置 :是否删除:0否 1是
	 */
	public void setDelFlag(String delFlag) {
		this.delFlag = delFlag;
	}

	/**	 
	 *获取 :是否删除:0否 1是
	 */
	public String getDelFlag() {
		return this.delFlag;
	}

	public Long getNotDialCount() {
		return notDialCount;
	}

	public void setNotDialCount(Long notDialCount) {
		this.notDialCount = notDialCount;
	}

	public Long getNotFollowCount() {
		return notFollowCount;
	}

	public void setNotFollowCount(Long notFollowCount) {
		this.notFollowCount = notFollowCount;
	}

	public Long getEffectiveCount() {
		return effectiveCount;
	}

	public void setEffectiveCount(Long effectiveCount) {
		this.effectiveCount = effectiveCount;
	}

	public Long getInvalidCount() {
		return invalidCount;
	}

	public void setInvalidCount(Long invalidCount) {
		this.invalidCount = invalidCount;
	}

	public String getEffectiveRate() {
		//转客率=(转客数/导入成功数)
		if(null!=this.effectiveCount && null!=this.successCount && this.successCount>0){
			try {
				double effectiveRateDouble=MathUtil.divide(new BigDecimal(this.effectiveCount),new BigDecimal(this.successCount), 2);
				String effectiveRateStr=String.valueOf(MathUtil.multiply(effectiveRateDouble, Double.valueOf("100")));
				return effectiveRateStr;
			} catch (NumberFormatException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
				return "0";
			}
		}
		return "0";
	}


	public void setEffectiveRate(String effectiveRate) {
		this.effectiveRate = effectiveRate;
	}

	public String getCreateUserName() {
		return createUserName;
	}

	public void setCreateUserName(String createUserName) {
		this.createUserName = createUserName;
	}


}
